$(document).ready(function () {
    /*默认语言*/
    var defaultLang = "en";
    $("[i18n]").i18n({
        defaultLang: defaultLang,
        filePath: "/web3d-personal-page-demo/src/i18n/",//web3d-personal-page-demo上线i18n路径配置
        filePrefix: "i18n_",
        fileSuffix: "",
        forever: true,
        callback: function () {
            console.log("i18n is ready.");
        },
    });
    /*中英文切换按钮*/
    $("#translate").click(function (e) {
        //console.log($(e.target).attr("value"));
        var a = $(e.target).val() == "cn" ? "en" : "cn";
        var b = a=="cn"?"中/En":"En/中";
        $(e.target).val(a);
        $(e.target).text(b);
        console.log($(e.target).val());
        //console.log("click 中文 btn");

        $("[i18n]").i18n({
            defaultLang: a,
            filePath: "/web3d-personal-page-demo/src/i18n/",
        });

    });

});
